package com.zmx.patients.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.patients.R;
import com.zmx.patients.pojo.HospMessage;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MakeAppointmentAdapter extends BaseAdapterRvList<MakeAppointmentAdapter.ViewHolder, HospMessage> {


    public MakeAppointmentAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, HospMessage hospMessage) {

        holder.address.setText("地址："+hospMessage.getAddress());
        holder.name.setText(hospMessage.getName());
        holder.desc.setText("简介："+hospMessage.getDescribe());

    }

    @NonNull
    @Override
    protected MakeAppointmentAdapter.ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        MakeAppointmentAdapter.ViewHolder holder = new MakeAppointmentAdapter.ViewHolder(inflater.inflate(R.layout.adapter_make_appointment, parent, false));
        return holder;

    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.desc)
        TextView desc;
        @BindView(R.id.address)
        TextView address;
        @BindView(R.id.name)
        TextView name;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }


}
